package stu.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import entity.stuCourse;
import stu.dao.StudentDaoImpl;


/**
 * Servlet implementation class UpdateCourse
 */
    @WebServlet("/UpdateCourse")
    public class UpdateCourse extends HttpServlet {
	private static final long serialVersionUID = 1L;      	
	
	    public UpdateCourse() {
	        super();
	      
	    }

		protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			request.setCharacterEncoding("UTF-8");
			response.setCharacterEncoding("UTF-8");
			response.setContentType("text/html;charset=utf-8");
			
//			HttpSession session = request.getSession();	
			String classroom=request.getParameter("classroom");
			String cname=request.getParameter("cname");
			String cno=request.getParameter("cno");
			String date=request.getParameter("date");
			StudentDaoImpl h1=new StudentDaoImpl();		
			h1.update(classroom,cname,cno,date);
//			response.getWriter().write("<script>alert('�޸ĳɹ�!');window.location.href='StudentIndex.jsp'</script>");
			request.getRequestDispatcher("FindCourse").forward(request, response);
		}
		
		
		
	
		protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
			// TODO Auto-generated method stub
			doGet(request, response);
		}

	}